package de.ghost23.common.process {
	import flash.events.IEventDispatcher;
	import flash.utils.Dictionary;

	/**
	 * This is the description of a Command, that Process and BranchProcess is capable to handle.
	 * A command has to use the EventDispatcher. It is recommended to use de.interone.events.DispatcherClass.
	 * @author Sven Busse
	 * @version 1.0
	 */
	public interface ICommand extends IEventDispatcher {

		/**
		 * Starts execution of this command
		 * @param	data The parameter container, which all Commands of a certain
		 * process can access.
		 */
		function execute(data:Dictionary):void;
		
		/**
		 * Cancels this command. This command stops its execution and throws an ProcessEvent.FAILED
		 * event, which will cause the hosting process to fail as well globally.
		 */
		function cancel():void;
	}
}